<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>

<html>
	<head>
		<meta charset="UTF-8" />
		<link rel="stylesheet" type="text/css" href="style/style.css" />
		<title>Categories</title>
	</head>
	<body>
		<%@ include file="/template/header.jsp" %>
		<div id="menu_categories">
			<ul id="menu_list_categories">
			<c:forEach items="${categories}" var="category">
				<li><a href="<%= contextPath %>/showCategory?id=${category.idCategory}">${category.name}</a></li>				
			</c:forEach>
			</ul>
		</div>
		
			<c:choose>
				<c:when test="${empty projects}">
					<BR/>
					<p>Selectionnez une catégorie.</p>
				</c:when>
				<c:otherwise>
					<div id="project_manage_display">
						<c:forEach items="${projects}" var="project">
							<div id="project">
								<h3 id="project_name"><a href="<%= contextPath %>/showProject?id=${project.idProject}">${project.name}</a></h3>
								<h4>Categorie : <a href="<%= contextPath %>/showCategory?id=${project.category.idCategory}">${project.category.name}</a></h4>
								<div id="project_description">
									<p>${project.description}</p>
								</div>
							</div>
						</c:forEach>
					</div>
				</c:otherwise>
			</c:choose>
		
		<%@ include file="/template/footer.jsp" %>
	</body>
</html>